Unity Game Development Cookbook by Paris Buttfield-Addison
Author:Paris Buttfield-Addison
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2019-03-12T00:00:00+00:00
Add a PlatformRiding component to the player character—that is, the object that has your CharacterCollider.
Play the game and jump onto an object that has a MovingPlatform component. Your character will be carried with the platform. Additionally, if you get off the platform and then stand in its way, you will be pushed by the platform as it moves into you.
Discussion
This recipe performs two different tests to see if the CharacterCollider needs to be moved:
First, it calculates the size of the capsule that the CharacterCollider occupies, and then asks Unity’s physics system to check to see what colliders also occupy this space. If a platform is pushing into the character, the two colliders will be intersecting, albeit by a small amount.
If the colliders are intersecting, then we ask the physics system to compute the depenetration vector. This is the amount of movement that it would take to move the player so that the two objects aren’t overlapping. It’s then a simple matter of moving the player by that vector, which means that it moves “out” of the platform; the net result is that the player is pushed away from the platform.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
3D Graphics | 3D Printing |
Adobe | CAD |
Computer Modelling | Desktop Publishing |
Electronic Documents | Rendering & Ray Tracing |
User Experience & Usability |
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7410)
Hands-On Unity 2022 Game Development by Nicolas Alejandro Borromeo(2556)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2537)
Autodesk Civil 3D 2024 from Start to Finish by Stephen Walz Tony Sabat(2413)
Mathematics for Game Programming and Computer Graphics by Penny de Byl(2326)
The 46 Rules of Genius: An Innovator's Guide to Creativity (Voices That Matter) by Marty Neumeier(2316)
Rapid Viz: A New Method for the Rapid Visualization of Ideas by Kurt Hanks & Larry Belliston(2200)
Learn Qt 5: Build modern, responsive cross-platform desktop applications with Qt, C++, and QML by Nicholas Sherriff(2183)
Taking Blender to the Next Level by Ruan Lotter(1991)
Fusion 360 for Makers by Lydia Sloan Cline(1989)
Express Your Creativity with Adobe Express by Rosie Sue(1974)
Hands-On Neural Networks with Keras by Niloy Purkait(1905)
Mastering GUI Programming with Python by Alan D. Moore(1773)
Game Physics Cookbook by Gabor Szauer(1577)
Creative Character Design by Bryan Tillman(1562)
Hands-On Unity 2022 Game Development - Third Edition by Nicolas Alejandro Borromeo(1483)
Unreal Engine 4 Game Development Quick Start Guide by Rachel Cordone(1442)
Hands-On GUI Application Development in Go by Andrew Williams(1439)
Qt 5 and OpenCV 4 Computer Vision Projects by Zhuo Qingliang(1423)